package com.camemax.amqp.service.impl;

import com.camemax.amqp.service.RabbitmqConsumerService;
import org.springframework.amqp.rabbit.annotation.RabbitHandler;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Service;

@Service
@RabbitListener( queues = {"email-queue"}) // 订阅指定队列的消息
public class EmailConsumerServiceImpl implements RabbitmqConsumerService {
    @RabbitHandler // 接受处理@RabbitListener输入的消息
    @Override
    public void consumer(String message) {
        System.out.println("email accepts message => "+ message);
    }
}
